package com.chenglu.android.common.utils;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.chenglu.android.R;


/**
 * @author: lyj
 * @Created: by Copyright 2023 3 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 * @Description：glide工具类
 */
public class GlideUtils {

    public static void setImageView(Context context, Object path, ImageView imageView, int rounddp){
        RequestOptions options = new RequestOptions()
                .placeholder(R.color.color_f6f6f6)
                .error(R.color.color_f6f6f6)
                .transform(new RoundedCorners(PxUtils.dp2px(rounddp)));
        Glide.with(context).load(path).apply(options).into(imageView);

    }

    public static void setImageView(Context context, Object path, ImageView imageView){
        RequestOptions options = new RequestOptions()
                .placeholder(R.color.color_f6f6f6)
                .error(R.color.color_f6f6f6);
        Glide.with(context).load(path).apply(options).into(imageView);

    }


}
